package com.example.demo.controller;


import com.example.demo.entity.Score;
import com.example.demo.mapper.ScoreMapper;
import com.example.demo.service.impl.ScoreServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 自动
 * @since 2019-01-14
 */
@RestController
@RequestMapping("/score")
public class ScoreController {
    @Autowired
    ScoreServiceImpl scoreService;
    @Autowired
    ScoreMapper  scoreMapper;
    @GetMapping(value = "/all")
    public void getAll() {
        //List<Score> list = scoreService.list();
        List<Score> list = scoreMapper.selectList(null);
        System.out.println("list: "+list.toString());

        for (int i = 0; i < list.size(); i++) {
            System.out.println("第"+i+"个:  "+list.get(i));
        }
    }
}
